package com.x25175.file.config;

/**
 * @author 徐佳辉
 * @date 2020/11/23 17:27
 */

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 资源映射路径
 */
@Configuration
public class MyWebAppConfigurer implements WebMvcConfigurer {
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/img/**").addResourceLocations("file:D:/file/img/");
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new RecordRunTime()).addPathPatterns("/login","/logout","/change",
                "/postregister","/deletepic","/delPic","/picturelist","/upload","/uploadOnlyPic","/deletearr","/deleteone"
                ,"/deletes","/edit","/exactquery","/export","/exportQuery","/exportSome","/getOne","/insert","/like","/list"
                ,"/listnotpic","/stuinsert","/stuinsert"
                );


    }
}

